home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #15
/
Monster Media Number 15 (Monster Media)(July 1996).ISO
/
prog_bas
/
pbc32.zip
/
PBC$BAS.ZIP
/
EXTRACT.BAS
< prev
next >
Wrap
BASIC Source File
|
1996-04-10
|
1KB
|
30 lines
' +----------------------------------------------------------------------+
' | |
' | PBClone (C) Copyright 1996 Charon Software, All Rights Reserved |
' | |
' +----------------------------------------------------------------------+
SUB Extract (St$, Delimiter$, Index%, Start%, SLen%)
Ind% = Index%
IF LEN(Delimiter$) > 0 AND Index% > 0 THEN
Start% = 1
DO
tmp% = INSTR(Start%, St$, Delimiter$)
Ind% = Ind% - 1
IF Ind% = 0 THEN
IF tmp% THEN
SLen% = tmp% - Start%
ELSE
SLen% = LEN(St$) - Start% + 1
END IF
ELSEIF tmp% = 0 THEN
SLen% = 0
ELSE
Start% = tmp% + LEN(Delimiter$)
END IF
LOOP UNTIL tmp% = 0 OR Ind% = 0
ELSE
SLen% = -1
END IF
END SUB